package com.example.weatherdemo;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

import android.util.Log;

public class WeatherHandler extends DefaultHandler{

	private String REQUEST;
	private String WEATHER;
	private String DATE;
	private String QUERY;
	private String TEMPMAXC;
	private String TEMPMINC;
	
	@Override
	public void startElement(String uri, String localName, String qName,
			Attributes attributes) throws SAXException {
		//Log.d("kt", "da chay den day");
		if(localName.equals("query")){
			setQUERY(attributes.getValue(0));
			
			}
		 if(localName.equals("date")){
			setDATE(attributes.getValue(0));
			
		}
		 if(localName.equals("tempMaxC")){
			setTEMPMAXC(attributes.getValue(0));
			
		}
		if(localName.equals("tempMinC")){
			setTEMPMINC(attributes.getValue(0));
		}
		super.startElement(uri, localName, qName, attributes);
	}

	public String getREQUEST() {
		return REQUEST;
	}

	public void setREQUEST(String rEQUEST) {
		REQUEST = rEQUEST;
	}

	public String getWEATHER() {
		return WEATHER;
	}

	public void setWEATHER(String wEATHER) {
		WEATHER = wEATHER;
	}

	public String getDATE() {
		return DATE;
	}

	public void setDATE(String dATE) {
		DATE = dATE;
	}

	public String getQUERY() {
		return QUERY;
	}

	public void setQUERY(String qUERY) {
		QUERY = qUERY;
	}

	public String getTEMPMAXC() {
		return TEMPMAXC;
	}

	public void setTEMPMAXC(String tEMPMAXC) {
		TEMPMAXC = tEMPMAXC;
	}

	public String getTEMPMINC() {
		return TEMPMINC;
	}

	public void setTEMPMINC(String tEMPMINC) {
		TEMPMINC = tEMPMINC;
	}

	
	
	
}
